package com.zr.dao.impl;

import java.util.List;

import javax.annotation.Resource;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.zr.dao.BaseDao;
import com.zr.dao.DeletePsfwDao;
import com.zr.model.Psfwb;
@Repository("deletepsfwdao")
public class DeletePsfwDaoImpl extends BaseDaOImpl implements DeletePsfwDao{
	@Resource
	private BaseDao baseDao;
	
	@Override
	public void DeletePsfw(int[] pids) {
		for (int i = 0; i < pids.length; i++) {
			String hql = "from Psfwb where pid=:pid";
			Query query= this.getCurrentSession().createQuery(hql);
			query.setInteger("pid", pids[i]);
			List<Psfwb> l = query.list();
			for (Psfwb psfwb : l) {
				this.delete(psfwb);
			}
		}
	}

}
